﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet" />
    <style>
        body {
            background: #f4f5f9;
        }

        .main {
            width: 100%;
        }

        .acdetamain_01 {
            width: 100%;
            padding: 5% 3%;
            background: #fff;
            padding-bottom: 0;
            margin-bottom: 3%;
        }

        .acdetamain1_sp1 {
            font-size: 1.7rem;
            display: block;
            margin-bottom: 2%;
        }

        .acdetamain1_sp2 {
            font-size: 1.4rem;
            display: block;
            color: #afafaf;
            margin-bottom: 2%;
        }

        .acdetamain_02 {
            width: 100%;
            max-height: 15rem;
            height: 15rem;
            position: relative;
            background-size: cover;
            margin-bottom: 2%;
        }

        .acdetamain_03 {
            width: 100%;
            overflow: hidden;
            border-top: 1px solid #efefef;
        }

        .acdetamain3_d1 {
            border-top: 1px solid #efefef;
            border-bottom: 1px solid #efefef;
            overflow: hidden;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .acdetamain3_sp1 {
            flex: 0.8;
        }

        .acdetamain_04 {
            padding: 4% 0;
            font-size: 1.6rem;
        }

        .acdetamain_05 {
            background: #fff;
            padding: 4% 3%;
        }

        .am-article-bd {
            color: #6b6b6b;
        }

        .mengceng {
            background: rgba(0,0,0,0.2);
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            display: none;
        }

        .signup {
            position: absolute;
            width: 100%;
            height: 60%;
            background: #fff;
            bottom: 0;
            overflow-y:auto
        }

        .clickhide {
            position: absolute;
            width: 100%;
            height: 40%;
            top: 0;
        }

        .signupshow {
            position: fixed;
            bottom: 0;
        }
		
        .acdetamain1_sy {
            position: relative;
        }
         .acdetamain1_sy img {
            vertical-align: top;
            width:100%;
        }
        .acdetamain1_sy p {
            position:absolute;
            left:0;
            bottom:0;
            font-size:12px;
            background:rgba(0,0,0,0.6);
            color: #fff;
            padding: 5px 10px;
            width:100%;
            margin:0;

        }
    </style>
</head>
<body>
    <div class="page" id="vult" v-cloak>

        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">{{actinfo.Act.Name}}</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <div class="main">
            <div class="acdetamain_01">
                <span class="acdetamain1_sp1">{{actinfo.Act.Name}}</span>
                <div class="acdetamain1_sy">
                    <img :src="actinfo.Act.faceImg" />
                    <p>报名时间：{{actinfo.startSignTime}} 至 {{actinfo.endSignTime}}</p>
                </div>
                <div class="acdetamain_03">
                    <div class="acdetamain3_d1">
                        <span class="am-icon am-icon-map-marker" style="text-align: center;flex: 0.1"></span>
                        <span class="acdetamain3_sp1" style="flex: 0.9">{{actinfo.Act.Adress}}</span>
                        <img src="images/activty_detail01.png" alt="" style="width: 20%;height: 6rem;max-width: 6rem;" v-on:click="toMap()">
                    </div>
                    <div class="acdetamain3_d1">
                        <span class="am-icon am-icon-phone" style="text-align: center;flex: 0.1"></span>
                        <span class="acdetamain3_sp1">{{actinfo.Act.Phone}}</span>
                        <a :href="'tel:'+actinfo.Act.Phone"><img src="images/activty_detail02.png" alt="" style="width: 100%;flex: 0.1;height: 6rem;max-width: 6rem;"></a>
                    </div>
                    <div class="acdetamain3_d1">
                        <span class="am-icon am-icon-clock-o" style="text-align: center;flex: 0.1"></span>
                        <span class="acdetamain3_sp1">{{actinfo.startTime}}至{{actinfo.endTime}}</span>
                        <span style="width: 20%;flex: 0.1;height: 6rem;max-width: 6rem;opacity: 0"></span>
                    </div>
                </div>
            </div>
            <div class="acdetamain_05" style="margin-bottom:37px;">
                <span style="display: block;margin: 3% 0">活动明细</span>
                <article class="am-article">
                    <div class="am-article-bd" v-html="actinfo.Act.Info"></div>
                </article>

            </div>
        </div>

        <button style="width: 100%;background: #6fddb1;color: #fff;" class="am-btn am-round signupshow">报名</button>
        <div class="mengceng">
            <div class="clickhide">

            </div>
            <div class="signup">
                <div style="text-align: center;width: 100%;    padding: 4%;border-bottom: 1px solid #efefef;">
                    <span>活动项目</span><span class="am-icon am-icon-close" style="font-weight: 100;float: right;font-size: 1.8rem;margin-top: -2%;"></span>
                </div>
                <div class="am-g" style="width: 100%; padding-left: 3%; padding-right: 3%; padding-top: 3%; font-size: 1.8rem; " v-for="it in item">
                    <div style=" border-bottom: 1px solid #E2E2E2;padding-left:0px;padding-right:0px; padding-bottom:3%" class="am-u-sm-12">
                        <div class="am-u-sm-4" style="padding: 0">{{it.Name}}</div>
                        <div class="am-u-sm-3" style="padding: 0;text-align: center">{{it.numSign}}/{{it.maxSign==0?"无上限":it.maxSign}}</div>
                        <div class="am-u-sm-3" style="padding: 0; text-align: center; color: #e88c66; font-size: 1.8rem;">￥{{it.Price}}</div>
                        <div class="am-u-sm-2" style="padding: 0;text-align: center">
                            <a href="javascript:" class="am-btm am-radius" style="background: #6fddb1;color: #fff;border: none;font-size: 1.8rem; width:100%;margin-top:0px; display:block;" v-on:click="Create(it.gId)">报名</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="https://use.fontawesome.com/ca6b609d64.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="https://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.js"></script>
</html>

<script>
    $(function () {
        var actid = $.getParam("gId");
        page.actid = actid;
        page.getInfo();
    })

    var page = new Vue({
        el: '#vult',
        data: {
            actid: 0,
            actinfo: { Act: {} },
            item: [],
        },
        methods: {
            getInfo: function () {
                var that = this;
                $.ajax({
                    type: 'GET',
                    url: apiUrl + '/Api/Field/GetActivityInfo',
                    data: { "gId": that.actid },
                    success: function (data) {
                        if (data.errcode == 0) {
                            that.actinfo = data.data.activityInfo;
                            that.item = data.data.activityInfo.item;
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            },
            toMap: function () {
                location.href = 'map.html?xPoint=' + this.actinfo.Act.xPoint + "&yPoint=" + this.actinfo.Act.yPoint;
            },
            Create: function (actitid) {
                var that = this;
                $.ajax({
                    url: apiUrl + "/Api/Field/SeeActivityForm",
                    data: { "gId": actitid },
                    type: "POST",
                    success: function (data) {
                        if (data.errcode == 0) {
                            location.replace("ActivityFormInfo.html?gId=" + data.data.gId);
                        } else {
                            alert(data.errmsg);
                        }

                    },
                })
            },
            cancel: function () {
                var that = this;
                if (confirm("确定取消订单吗？")) {
                    $.ajax({
                        url: thisUrl + "/Api/Field/ReserveOrderCancel",
                        data: { Id: that.orderid },
                        type: "POST",
                        success: function (data) {
                            if (data.errcode == 0) {
                                alert("取消成功");
                                location.replace(location.href);
                            } else {
                                alert(data.errmsg);
                            }
                        },
                        //error: function () {
                        //    alert("服务器响应异常");
                        //}
                    })
                }

            }
        }
    });
</script>
<script>
    //点击显示报名
    $('.signupshow').click(function () {
        $('.mengceng').show();
    });
    //点击关闭报名
    $('.am-icon-close').click(function () {
        $('.mengceng').hide();
    });
    //点击关闭报名
    $('.clickhide').click(function () {
        $('.mengceng').hide();
    });
</script>
